export default  function matrixMultiplication(matrix1, matrix2) {
    let result = [];
    for (let i = 0; i < matrix1.length; i++) {
        result[i] = [];
        for (let j = 0; j < matrix2[0].length; j++) {
            let sum = 0;
            for (let k = 0; k < matrix1[0].length; k++) {
                sum += matrix1[i][k] * matrix2[k][j];
            }
            result[i][j] = sum;
        }
    }
    return result;
}

// 定义两个矩阵
let matrix1 = [
    [11, 22, 33, 33],
    [11, 22, 33, 33],
    [11, 22, 33, 33],
    [11, 22, 33, 33]
];

let matrix2 = [
    [1, 2, 3, 4],
    [1, 2, 3, 4],
    [1, 2, 3, 4],
    [1, 2, 3, 4]
];

// 计算矩阵的乘法
let resultMatrix = matrixMultiplication(matrix1, matrix2);

console.log("矩阵相乘的结果为: ");
console.log(resultMatrix);
